package com.zzy.face.model;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import javax.persistence.*;
import java.util.List;

/**
 * @Author 朱泽玉
 * @Create 2022/1/29 10:16
 * @Description 教师信息
 * @Modified By:
 */
@Data
@Entity
public class Teacher {
    @Id
    @JsonSerialize(using = ToStringSerializer.class)
    private Long uid;

    @MapsId
    @OneToOne(cascade = CascadeType.ALL)
    @JsonBackReference
    private Account account;

    @OneToMany(mappedBy = "teacher")
    @JsonBackReference
    private List<RLSchool> rlSchoolList;

}
